/*
 * @Date: 2022-04-15 10:51:53
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-04-15 17:18:59
 * @FilePath: \Vue3-ts-cms\src\views\login\config\account-config.ts
 * @description: 文件描述
 */
// 编写好规则
const AvatarRules = {
  name: [
    {
      required: true,
      message: '请填写用户名',
      trigger: 'blur'
    },
    {
      pattern: /^[a-z0-9]{5,10}$/,
      message: '用户名必须是5~10个字母或者数字~',
      trigger: 'blur'
    }
  ],
  password: [
    {
      required: true,
      message: '请填写密码',
      trigger: 'blur'
    },
    {
      pattern: /^[a-z0-9]{3,}$/,
      message: '用户名必须是3位以上的字母或者数字~',
      trigger: 'blur'
    }
  ]
}

const IphoneRules = {
  number: [
    {
      required: true,
      message: '请填写手机号',
      trigger: 'blur'
    },
    {
      pattern: /^[0-9]{11,11}$/,
      message: '请填写正确手机号~',
      trigger: 'blur'
    }
  ],
  code: [
    {
      required: true,
      message: '请填写密码',
      trigger: 'blur'
    },
    {
      pattern: /^[a-z0-9]{6,6}$/,
      message: '验证码必须是6位字母或者数字~',
      trigger: 'blur'
    }
  ]
}

export { AvatarRules, IphoneRules }
